var LabelInputControl = Class.create(InputControl, {
     observeEvent: function($super){
        $super();
        this.loadLabel();
        this.view.observe('focus', this.clear.bind(this));
        this.view.observe('blur', this.loadLabel.bind(this));
    },

    clear: function()
    {
        if (this.view.value == this.getLabel()) this.view.value = '';
        this.view.removeClassName('light');
    },

    onChange: function($super)
    {
        $super();
        this.loadLabel();
    },

    loadLabel: function()
    {
        var view = this.view;
        if (!view.value)
        {
            view.value = this.getLabel();
            view.addClassName('light');
        }
        else if (view.value != this.getLabel())
        {
            view.removeClassName('light');
        }
    },

    getLabel: function()
    {
        return this.view.getAttribute('label');
    }
});